package com.css.zfzx.sjcj.modules.qhsiteclassresult;

import com.css.zfzx.sjcj.modules.qhsiteclassresult.repository.QhSiteClassUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource("application-prod.yml")
public class LoadSiteClassStartupRunner implements CommandLineRunner {

    //获取配置文件的上传文件路径
    @Value("${file.static_data.site.siteClassPath}")
    private String siteClassPath;

    @Override
    public void run(String... args) {
        String rootPath = System.getProperty("user.dir").replace("\\", "/");
        siteClassPath = rootPath + siteClassPath;
        QhSiteClassUtil.initialize(siteClassPath);
    }
}
